package com.boost.tjvm.agent;
import com.sun.tools.attach.*;

import java.io.IOException;

public class AttachTest {
    public static void main(String[] args) throws AttachNotSupportedException, IOException, AgentLoadException, AgentInitializationException {
        if (args.length <= 1) {
            System.out.println("Usage: java AttachTest /PATH/TO/AGENT.jar");
            return;
        }
        VirtualMachine vm = VirtualMachine.attach(args[0]);
        //对应agentmain 方法的第一个参数
        vm.loadAgent(args[1],"com.boost.tjvm.agent.Test");
    }
}